package com.itheima.Test;

public class AAATest003 implements Runnable {
    static int a = 100;

    @Override
    public void run() {
        while (true){
            if(a<=0){
                break;
            }
            show();
        }

    }

    public static synchronized void show() {
        if (a >0) {
            System.out.println(Thread.currentThread().getName()+"售出了"+a+"号票");
                a--;
        }

    }
}
